package com.yhy.common.security.service;

import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;

public interface MyUserDetailsService extends UserDetailsService {

    /**
     * 用户名获取用户
     *
     * @param username 用户名
     * @return UserDetails
     */
    @Override
    UserDetails loadUserByUsername(String username);

    /**
     * 社交方式获取用户
     *
     * @param unionId 微信unionId
     * @param appId   微信appId
     * @param openId  用户openId
     * @return UserDetails
     */
    UserDetails loadUserByUnionId(String unionId, String appId, String openId);

    /**
     * 手机号方式获取用户
     *
     * @param phone 手机号
     * @return UserDetails
     */
    UserDetails loadUserByMobile(String phone);

}
